<?php

    $per_page=10;
    //设置固定5页的页码数
    $page_num=5;
    //获取当前页数
    $cur_page=empty($_GET['p'])?1:$_GET['p'];
    //页码偏移公式（当前页码-1）*总页码
    $offset=($cur_page-1)*$per_page;

    $pages=getpage($link,'admin', $per_page,$page_num,$cur_page);

 $sql="select * from `admin` order by `id` limit $offset,$per_page ";

            //取出数据
 $result=mysqli_query($link,$sql);
            //用while循环把数据放入到数组中去
 if(!empty($result)){
    while($arr = mysqli_fetch_assoc($result)){
        $data[]= $arr;
    }
}
 // print_r(date("Y-m-d H:i:s", $data[0]['creat_time']) );die;
include(VIEW_PATH.$admin.'layout.html');
?>